package com.lagou.service;

import org.springframework.stereotype.Service;


@Service
public class UserServiceImpl implements  UserService {
    public String sayHello(String word) {
        System.out.println("调用成功 -- 参数 : " + word);
        return "调用成功 -- 参数 : " + word;
    }

//    public static void startServer(String hostName, int port) throws InterruptedException {
//        EventLoopGroup bossGroup = new NioEventLoopGroup();
//        EventLoopGroup workerGroup = new NioEventLoopGroup();
//
//        ServerBootstrap serverBootstrap = new ServerBootstrap();
//        serverBootstrap.group(bossGroup, workerGroup)
//                .channel(NioServerSocketChannel.class)
//                .childHandler(new ChannelInitializer<SocketChannel>() {
//
//                    protected void initChannel(SocketChannel ch) throws Exception {
//                        ChannelPipeline pipeline = ch.pipeline();
//                        pipeline.addLast(new StringEncoder());
////                        pipeline.addLast(new StringDecoder());
//                        pipeline.addLast(new RpcDecoder(RpcRequest.class, new JSONSerializer()));
//                        pipeline.addLast(new UserServerHandler());
//                    }
//                });
//
//        serverBootstrap.bind(hostName, port).sync();
//    }
}
